import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment"
//楼宇闸机api
const buildGateApi = {
    //列表
    List: function (areaId,buildingId,pageNumber,pageSize) {
        const data = {areaId,buildingId,pageNumber,pageSize};
        return request({
            url: baseUrl + "/manageBuildingAccess/accessList",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //保存
    Save:function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl+'/manageBuildingAccess/save',data,config)
    },
    //查询
    getAccessInfo: function (buildingId ) {
        const data = {buildingId };
        return request({
            url: baseUrl + "/manageBuildingAccess/getAccessInfo",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //删除
    getAccessInfoDel: function (buildingIds) {
        const data = {buildingIds};
        return request({
            url: baseUrl + "/manageBuildingAccess/deleteBuildingAccess",
            method: "post",
            data: qs.stringify(data)
        });
    },
   
}

export {buildGateApi}
